const { list } = require('./data/user')
const base = '/shopmovie'

module.exports = [{
  url: `${base}/shopPlayers`,
  type: 'get',
  response: config => {
    const { page, limit, phoneNumber, text } = config.query
    const res = list(page, limit, phoneNumber, null, null, null, text)
    res.data.records.forEach((u, idx) => {
      u.userId = u.id
      if (idx % 3 === 1) {
        u.nickname = ''
      } else if (idx % 5 === 1) {
        u.nickname = null
      } else if (idx % 5 === 2) {
        u.nickname = undefined
      }
    })
    return res
  }
}]
